#include<stdio.h>
int main()
{
	float f,m,c;
	int n;
	scanf("%f%f%d",&f,&m,&n);
	if(n==1)
		printf("%.2f",(f+m)*1.08/2);
	else
		printf("%.2f",(f*0.923+m)/2);
}
